package com.gxy.learn.design.model.behaviour.visitor;

import java.util.ArrayList;
import java.util.List;

/**
 * @description:
 * @author: gaoxueyong
 * @Date: 2022/11/8 22:19
 */
public class Home {
    private List<Animail> nodeList = new ArrayList<>();
    public void add(Animail animail){
        nodeList.add(animail);
    }
    public void action(Person person){
        for (Animail animail : nodeList) {
            animail.accetp(person);
        }
    }
}
